package com.tan.po;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component//IOC
public class UserInfo {
    @Value("1")//di注入 可以不写set和构造 底层通过私有字段的暴力访问注入的
    private Integer id;
    @Value("张三")
    private String name;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "UserInfo{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

}
